xin=input()
year=int(input())
if xin=="boy":
    if year>=22:
        print('yes')
    else:
        print('no')
elif xin=="girl":
    if year>=20:
        print('yes')
    else:
        print('no')
else:
    print("Unrecognized gender")